package com.zcxy.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zcxy.mybatis.bean.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 角色
 * 
 * @author zcc
 * @email 860474958@qq.com
 * @date 2020-06-02
 */
@Data
@TableName("sys_role")
@ApiModel(value = "SysRole", description = "角色实体对象")
public class SysRole extends BaseEntity  {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键", required = false)
    @TableId(type = IdType.UUID)
    private String id;
    @ApiModelProperty(value = "角色名称", required = false)
    @NotEmpty(message = "角色名称不能为空")
    @Length(max = 50, message = "roleName 超出最大长度50")
    private String roleName;

    @ApiModelProperty(value = "描述", required = false)
    @Length(max = 255, message = "description 超出最大长度255")
    private String description;

    @ApiModelProperty(value = "启用(0未启用1启用)", required = false)
    private String status;

    @ApiModelProperty(value = "全部工作区（0非全工作区，1全工作区）", required = false)
    private String usedAllworkspace;

    @ApiModelProperty(value = "唯一编码", required = false)
    @NotEmpty(message = "唯一编码code不能为空")
    @Length(max = 50, message = "code 超出最大长度50")
    private String code;

    @ApiModelProperty(value = "用户id集合", required = false)
    @TableField(exist = false)
    private List<String> userIds;

    @ApiModelProperty(value = "用户组id集合", required = false)
    @TableField(exist = false)
    private List<String> userGroupIds;

}
